package top.fyxxxx.dbdesign.data;


import java.util.Map;
import java.util.TreeMap;

//一个用户单课程的所有信息
public class PersonalData {
    private Account account;//用户的账号信息
    private Course course;//课程信息
    private long joinTime;//加入时间
    private long power;//用户对课程的权限
    private int signin;
    private TreeMap<SignInTask,SignInRecord> totalTask;//所有签到任务，按时间排序，没有签到的record为null
    public  PersonalData(Account account,Course course,TreeMap<SignInTask,SignInRecord> totalTask,long joinTime,long power)
    {
        this.account=account;
        this.course=course;
        this.totalTask=totalTask;
        this.joinTime=joinTime;
        this.power=power;
        this.signin=0;
        for(SignInRecord record:totalTask.values())if(record!=null)this.signin++;
    }
    public Account getAccount() {
        return account;
    }

    public long getPower() {
        return power;
    }

    public int getSignInNum(){
        return signin;
    }
    public int getUnSignInNum(){
        return totalTask.size()-signin;
    }

    public void setPower(long power) {
        this.power = power;
    }

    public void setAccount(Account account) {
        this.account = account;
    }

    public long getJoinTime() {
        return joinTime;
    }

    public void setJoinTime(long joinTime) {
        this.joinTime = joinTime;
    }

    public Course getCourse() {
        return course;
    }

    public void setCourse(Course course) {
        this.course = course;
    }

    public TreeMap<SignInTask, SignInRecord> getTotalTask() {
        return totalTask;
    }

    public void setTotalTask(TreeMap<SignInTask, SignInRecord> totalTask) {
        this.totalTask = totalTask;
    }
}
